//
//  FootprintCell.m
//  ZhiHuiLiJiang
//
//  Created by Work on 2018/11/18.
//  Copyright © 2018年 王雅鹏. All rights reserved.
//我的足迹cell--已废弃

#import "FootprintCell.h"

@implementation FootprintCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addView];
    }
    return self;
}
-(void)addView{
    [self.contentView addSubview:self.HimageView];
    [self.contentView addSubview:self.contentLabel];
    [self.contentView addSubview:self.conteryLabel];
    [self.contentView addSubview:self.numLabel];
    [self.contentView addSubview:self.timeLabel];
    
//    self.conteryLabel.backgroundColor = BYCyanColor;
//    self.numLabel.backgroundColor = BYOrangeColor;
//    self.timeLabel.backgroundColor = BYCyanColor;
    
    [self.HimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(BY_Height(14));
        make.size.mas_equalTo(CGSizeMake(BY_Width(200), BY_Width(118)));
        make.left.equalTo(self.contentView.mas_left).offset(BY_Width(108));
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.HimageView.mas_top).offset(BY_Height(5));
        make.left.equalTo(self.HimageView.mas_right).offset(BY_Width(32));
        make.right.equalTo(self.contentView.mas_right).offset(-BY_Width(20));
    }];
    [self.conteryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentLabel.mas_bottom).offset(BY_Height(10));
        make.left.equalTo(self.contentLabel.mas_left);
        make.width.offset(BY_Width(150));
    }];
    [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.conteryLabel.mas_centerY);
        make.left.equalTo(self.conteryLabel.mas_right).offset(BY_Width(10));
        make.width.offset(BY_Width(80));
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.conteryLabel.mas_centerY);
        make.left.equalTo(self.numLabel.mas_right).offset(BY_Width(10));
        make.right.equalTo(self.contentLabel.mas_right);
    }];
}
- (UILabel *)contentLabel{//标题
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc]init];
        _contentLabel.textColor = BYColor5;
        _contentLabel.font = BYPTFont32;
        _contentLabel.numberOfLines = 2;
        [_contentLabel sizeToFit];
    }
    return _contentLabel;
}
- (UILabel *)conteryLabel{
    if (!_conteryLabel) {
        _conteryLabel = [[UILabel alloc]init];
        _conteryLabel.textColor = BYColor2;
        _conteryLabel.font = BYPTFont24;
        [_conteryLabel sizeToFit];
    }
    return _conteryLabel;
}
- (UILabel *)numLabel{
    if (!_numLabel) {
        _numLabel = [[UILabel alloc]init];
        _numLabel.textColor = BYColor2;
        _numLabel.font = BYPTFont24;
        [_numLabel sizeToFit];
    }
    return _numLabel;
}
- (UILabel *)timeLabel{
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc]init];
        _timeLabel.textColor = BYColor2;
        _timeLabel.font = BYPTFont24;
        [_timeLabel sizeToFit];
    }
    return _timeLabel;
}
- (UIImageView *)HimageView{//图片
    if (!_HimageView) {
        _HimageView  = [[UIImageView alloc]init];
    }
    return _HimageView;
}
- (void)add:(NSString *)str{
    [self.HimageView mas_updateConstraints:^(MASConstraintMaker *make) {
        if ([str isEqualToString:@"1"]) {
            make.left.equalTo(self.contentView.mas_left).offset(50);
        }else{
            make.left.equalTo(self.contentView.mas_left).offset(10);
        }
    }];
}
-(void)setModel:(BYcitizenModel *)model{
    
    self.timeLabel.text =model.time;
    self.contentLabel.text =model.intro;
    self.numLabel.text =model.tag;
    self.conteryLabel.text =model.author;

}

@end
